var t = require("../core");
Component((0, t.formItem)()({
  externalClasses: ["custom-class", "input-class"],
  properties: {
    placeholderStyle: {
      type: String,
      value: "color: #bfbfbf"
    },
    maxlength: {
      type: null,
      value: 140
    },
    disabled: {
      type: Boolean,
      value: !1
    },
    type: {
      type: String,
      value: "text"
    },
    placeholder: {
      type: String,
      value: "请输入"
    },
    password: {
      type: Boolean,
      value: !1
    },
    value: {
      type: String || Number,
      value: ""
    },
    autoFocus: {
      type: Boolean,
      value: !1
    },
    adjustPosition: {
      type: Boolean,
      value: !0
    }
  },
  data: {
    focus: !1,
    showInput: !1,
    inputDisabled: !0
  },
  observers: {
    disabled: function () {
      this.data.disabled && this.setData({
        inputDisabled: this.data.disabled
      })
    }
  },
  lifetimes: {
    ready: function () {
      var t = this.data,
        e = t.disabled,
        a = t.autoFocus;
      e && this.setData({
        inputDisabled: this.data.disabled
      }), a && this.onFocus()
    }
  },
  methods: {
    onTap: function () {
      this.data.disabled || this.setData({
        inputDisabled: !1,
        focus: !0
      })
    },
    onInput: function (t) {
      this.onChange(t.detail.value)
    },
    onBlur: function (t) {
      this.setData({
        inputDisabled: !0,
        focus: !1
      }), this.triggerEvent("blur", t.detail)
    },
    onFocus: function (t) {
      this.setData({
        inputDisabled: !1,
        focus: !0
      }), t && this.triggerEvent("focus", t.detail)
    },
    onBindkeyboardheightchange: function (t) {
      this.triggerEvent("keyboardheightchange", t.detail)
    }
  }
}));